package com.ruoyi.system.service.impl;

import com.ruoyi.common.utils.SecurityUtils;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ZnStockCheckHistoryMapper;
import com.ruoyi.system.domain.ZnStockCheckHistory;
import com.ruoyi.system.service.IZnStockCheckHistoryService;

/**
 * 库存巡检记录Service业务层处理
 * 
 * @author nexiaozi
 * @date 2022-11-12
 */
@Service
public class ZnStockCheckHistoryServiceImpl implements IZnStockCheckHistoryService 
{
    @Autowired
    private ZnStockCheckHistoryMapper znStockCheckHistoryMapper;

    /**
     * 查询库存巡检记录
     * 
     * @param id 库存巡检记录主键
     * @return 库存巡检记录
     */
    @Override
    public ZnStockCheckHistory selectZnStockCheckHistoryById(Long id)
    {
        return znStockCheckHistoryMapper.selectZnStockCheckHistoryById(id);
    }

    /**
     * 查询库存巡检记录列表
     * 
     * @param znStockCheckHistory 库存巡检记录
     * @return 库存巡检记录
     */
    @Override
    public List<ZnStockCheckHistory> selectZnStockCheckHistoryList(ZnStockCheckHistory znStockCheckHistory)
    {
        return znStockCheckHistoryMapper.selectZnStockCheckHistoryList(znStockCheckHistory);
    }
     /**
      * 查询库存巡检记录记录数
      *
      * @param znStockCheckHistory 库存巡检记录
      * @return 库存巡检记录记录数
     */
    public Integer selectZnStockCheckHistoryCount(ZnStockCheckHistory znStockCheckHistory){
        return znStockCheckHistoryMapper.selectZnStockCheckHistoryCount(znStockCheckHistory);
    }


    /**
     * 新增库存巡检记录
     * 
     * @param znStockCheckHistory 库存巡检记录
     * @return 结果
     */
    @Override
    public int insertZnStockCheckHistory(ZnStockCheckHistory znStockCheckHistory)
    {
        znStockCheckHistory.setCreateTime(DateUtils.getNowDate());
        return znStockCheckHistoryMapper.insertZnStockCheckHistory(znStockCheckHistory);
    }

    /**
     * 修改库存巡检记录
     * 
     * @param znStockCheckHistory 库存巡检记录
     * @return 结果
     */
    @Override
    public int updateZnStockCheckHistory(ZnStockCheckHistory znStockCheckHistory)
    {
        return znStockCheckHistoryMapper.updateZnStockCheckHistory(znStockCheckHistory);
    }

    /**
     * 批量删除库存巡检记录
     * 
     * @param ids 需要删除的库存巡检记录主键
     * @return 结果
     */
    @Override
    public int deleteZnStockCheckHistoryByIds(Long[] ids)
    {
        return znStockCheckHistoryMapper.deleteZnStockCheckHistoryByIds(ids);
    }

    /**
     * 删除库存巡检记录信息
     * 
     * @param id 库存巡检记录主键
     * @return 结果
     */
    @Override
    public int deleteZnStockCheckHistoryById(Long id)
    {
        return znStockCheckHistoryMapper.deleteZnStockCheckHistoryById(id);
    }
}
